<template>
	<view class="content">
		<view class="info-block">
			<image :src="info.image" class="img"></image>
			<view class="right-item" @click="navigate('/pages/situation/situation')">
				<view class="title-item">
					<view class="title FangZhengHanZhenGuangBiaoJianTi">东北街道介绍</view>
					<view class="text">一切工作党建引领，一切困难党建解决。</view>
				</view>
				<image class="iconfont icon-a-gengduo1" src="https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/home/dongbeijiedao/more.png" mode=""></image>
			</view>
		</view>
		<view class="menu-block">
			<view class="title FangZhengHanZhenGuangBiaoJianTi">社区介绍</view>
			<view class="info-item">
				<view class="info-list" v-for="(item,index) in list" :key="item.id"
				@click="navigate('/pages/index/detail?id='+item.id +'&title='+item.name)">
					<!-- @click="navigate(item.src)"> -->
					<view class="name">{{item.name}}</view>
					<view class="info">
						<!-- <view class="count">{{item.count}}个</view> -->
						<!-- <view class="iconfont icon-youjiantou"></view> -->
						<image class="iconfont right" src="https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/home/dongbeijiedao/right.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		showDevelopingTips
	} from '@/util/util.js';
	import {
		getCommunityListApi
	} from '@/api/community.js'
	export default {
		data() {
			return {
				info: {
					image: '/static/images/news/content.png'
				},
				menuList: [{
						id: 1,
						icon: '/static/images/news/rudang.png',
						title: '我要入党',
						path: ''
					},
					{
						id: 2,
						icon: '/static/images/news/dangfeijiaona.png',
						title: '党费缴纳',
						path: ''
					},
					{
						id: 3,
						icon: '/static/images/news/help.png',
						title: '困难党员救助申请',
						path: ''
					}
				],
				list: [{
					id:12,
					name:'民主街社区',
					src:'/page_other/organization/detail1'
				},
				{
					id:9,
					name:'仓后街社区',
					src:'/page_other/organization/detail2'
				},
				{
					id:8,
					name:'北新街社区',
					src:'/page_other/organization/detail3'
				},
				{
					id:13,
					name:'同德巷社区',
					src:'/page_other/organization/detail4'
				},
				{
					id:10,
					name:'东文化街社区',
					src:'/page_other/organization/detail5'
				},
				{
					id:11,
					name:'汉唐街北社区',
					src:'/page_other/organization/detail6'
				},
				{
					id:14,
					name:'西北街社区',
					src:'/page_other/organization/detail7'
				}]
			}
		},
		methods: {
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			menuJump(url, id, title) {
				if (id != 1) {
					if (url) {
						uni.navigateTo({
							url: url + '?title=' + title
						})
					} else {
						// showDevelopingTips();
						uni.showToast({
							title: '该功能暂未开放',
							icon: 'none'
						})
					}
				} else {
					wx.navigateToMiniProgram({
						appId: 'wxd2ade0f25a874ee2'
					})
				}
			},
			// getList() {
			// 	uni.showLoading({
			// 		title: '加载中',
			// 		mask: true
			// 	})
			// 	getCommunityListApi().then(data => {
			// 		uni.hideLoading()
			// 		this.list = data
			// 	}).catch(() => {
			// 		uni.hideLoading()
			// 	})
			// }
		},
		onLoad() {
			// this.getList()
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		min-height: 100vh;
		background-color: #BA1519;
		padding: 30rpx;

		.info-block {
			background-color: #fff;
			border-radius: 20rpx;
			padding: 30rpx;
			display: flex;
			align-items: center;
			margin-bottom: 30rpx;

			.img {
				width: 160rpx;
				height: 160rpx;
				border-radius: 20rpx;
				margin-right: 20rpx;
			}

			.right-item {
				width: calc(100% - 180rpx);
				display: flex;
				justify-content: space-around;
				align-items: center;
				
				.icon-a-gengduo1{
					width: 50rpx;
					height: 50rpx;
				}

				.title-item {
					width: calc(100% - 40rpx);
					height: 120rpx;
					display: flex;
					flex-direction: column;
					justify-content: space-between;


					.title {
						color: #BA1519;
					}

					.text {
						font-size: 28rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 2;
						-webkit-box-orient: vertical;
					}
				}

				.iconfont {
					font-size: 30rpx;
					font-weight: bold;
					color: #767676;
				}
			}
		}

		.menu-block {
			background-color: #fff;
			border-radius: 20rpx;
			padding: 30rpx;
			display: flex;
			flex-direction: column;
			margin-bottom: 30rpx;

			.title {
				color: #BA1519;
				margin-bottom: 20rpx;
			}


			.info-item {
				width: 100%;
				// display: flex;
				// align-items: center;
				// flex-wrap: wrap;
				// margin-top: 30rpx;

				.info-list:nth-child(2) {
					background-color: #FEF7ED;
				}

				.info-list:nth-child(3) {
					background-color: #FEF6F4;
				}

				.info-list:nth-child(4) {
					background-color: #EBFAFD;
				}

				.info-list:nth-child(6) {
					background-color: #FEF7ED;
				}

				.info-list:nth-child(7) {
					background-color: #FEF6F4;
				}

				.info-list:nth-child(8) {
					background-color: #EBFAFD;
				}

				.info-list {
					box-sizing: border-box;
					width: 100%;
					margin-top: 20rpx;
					background-color: #ECFAED;
					margin-bottom: 20rpx;
					padding: 30rpx 40rpx;
					border-radius: 20rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					height: 140rpx;

					.name {
						font-size: 32rpx;
					}

					.info {
						// display: flex;
						// justify-content: space-between;
						// margin-top: 20rpx;
						width: 40rpx;
						height: 40rpx;
						
						.right{
							width: 100%;
							height: 100%;
						}
						
						.iconfont {
							font-size: 40rpx;
							color: #BA1519;
						}

						.count {
							color: #BA1519;
							font-size: 28rpx;
						}

						.img {
							width: 40rpx;
							height: 40rpx;
						}
					}
				}

				.info-list:nth-child(2n) {
					margin-right: 0;
				}
			}
		}
	}
</style>